import { Home } from "@/page/Home";
// import Layout from "@/page/Layout";
import Login from "@/page/Login";
import { Market } from "@/page/Market";
import { Navigate,useRoutes } from "react-router-dom";


export const routerConfig = [
    {
        path:'/',
        element:<Navigate to ="/login" />,
        // name:'login',
    },
    {
        path:"/login",
        element:<Login />,
        meta: {
            require:false,
            title:"登录",
            key:'login'
        }
    },
    {
        path:'/home',
        title:'首页',
        key:'index',
        element:<Home />
    },
    {
        path:'/market',
        element:<Market/>,
        title:'市场',
        key:'market',
    }
    // {
    //     path:'/index/*',
    //     element:<Layout />,
    //     meta:{
            
    //     },
    //     children:[
    //         {
    //             path:'/index/*/market',
    //             name:'市场',
    //             element:<Market />
    //         }
    //     ]
    // }
]

const Router = () => {
    const routes = useRoutes(routerConfig)
    return routes
}

export default Router
